/** @ingroup processing
 * @file working_timer.h
 * @brief periodically call functions
 *
 * @author cameris camerisdump@gmail.com
 */

#ifndef _WORKING_TIMER_H
#define _WORKING_TIMER_H

/** @name working timer hardware settings
 * @{ */
#define WTIMER_TIMERA	TCCR1A
#define WTIMER_COM0		COM1A0
#define WTIMER_COM1		COM1A1
#define WTIMER_WGM0		WGM10
#define WTIMER_WGM1		WGM11

#define WTIMER_TIMERB	TCCR1B
#define WTIMER_WGM2		WGM12
#define WTIMER_CS0		CS10
#define WTIMER_CS1		CS11
#define WTIMER_CS2		CS12

#define WTIMER_OCRH		OCR1AH
#define WTIMER_OCRL		OCR1AL

#define WTIMER_INT_REG	TIMSK1
#define WTIMER_INT		OCIE1A

#define WTIMER_INT_VECT	TIMER1_COMPA_vect
/**@} */

#define MAX_WORKERS 4
#define WTIMER_MS 10

void wtimer_init(void);
void wtimer_add(void (*worker)(void));
#endif
